<?php

	if ( !isset($module) ) {

		$module = '';

	}

	$action = $this->params['action'];
	
	$administrationModules = array("Category", "Admin Home");
	
	if ( in_array($module, $administrationModules) ) {
		
		echo "<a href='#'>Administration</a>";
		
	} else {

		echo "<a href='#'>" . $module . "</a>";	
		
	}	

	echo "<ul class='nav''>";
	if ( $module == 'Journal' ) {

		echo "<li " . ( ($action == 'add' || $action == 'edit' ) ? 'class=active' : '') . ">" . $this->Html->link('Journal Entry', array('controller' => 'ledgers', 'action' => 'add')) . "</li>";	
		echo "<li " . ($action == 'index' ? 'class=active' : '') . ">" . $this->Html->link('Journal Listing', array('controller' => 'ledgers', 'action' => 'index')) . "</li>";
		echo "<li " . ($action == 'import' ? 'class=active' : '') . ">" . $this->Html->link('Export Data', array('controller' => 'ledgers', 'action' => 'export'), array(), "Are you sure you wish to download the ledger listing?") . "</li>";		
		echo "<li " . ($action == 'import_ledger' ? 'class=active' : '') . ">" . $this->Html->link('Import Data', array('controller' => 'ledgers', 'action' => 'import_ledger')) . "</li>";			
	
	}

	if ( $module == 'Invoice' ) {

		echo "<li " . ( ($action == 'add' || $action == 'edit' ) ? 'class=active' : '') . ">" . $this->Html->link('Invoice Entry', array('controller' => 'invoice_headers', 'action' => 'add')) . "</li>";	
		echo "<li " . ($action == 'index' ? 'class=active' : '') . ">" . $this->Html->link('Invoice Listing', array('controller' => 'invoice_headers', 'action' => 'index')) . "</li>";
		echo "<li " . ($action == 'import' ? 'class=active' : '') . ">" . $this->Html->link('Export Data', array('controller' => 'invoice_headers', 'action' => 'export'), array(), "Are you sure you wish to download the invoice listing?") . "</li>";		
		echo "<li " . ($action == 'import_ledger' ? 'class=active' : '') . ">" . $this->Html->link('Import Data', array('controller' => 'invoice_headers', 'action' => 'import')) . "</li>";			

	}

	if ( in_array($module, $administrationModules) ) {

		echo "<li " . ($module == 'Category' ? 'class=active' : '') . ">" . $this->Html->link('Categories', array('controller' => 'categories', 'action' => 'index')) . "</li>";
		

	}
	
	echo "</ul>";
?>

